//
//  NoticeTableViewCell.m
//  GuoBuJiaForIphone
//
//  Created by zhangwo on 16/11/2.
//  Copyright © 2016年 GuoBuJia. All rights reserved.
//

#import "NoticeTableViewCell.h"

@implementation NoticeTableViewCell
@synthesize bgView = _bgView;
@synthesize departmentLabel = _departmentLabel;
@synthesize contentLabel = _contentLabel;
@synthesize timerLabel = _timerLabel;
@synthesize dataList = _dataList;

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _bgView = [[UIView alloc] initWithFrame:CGRectMake(10, 0, SWIDTH-20, 120)];
        _bgView.backgroundColor = [UIColor colorWithHexString:@"0xE5E5E5"];
        _bgView.layer.cornerRadius = 10;
        _bgView.userInteractionEnabled = YES;
        [self addSubview:_bgView];
        
        _departmentLabel = [[UILabel alloc] initWithFrame:CGRectMake(5, 5, _bgView.frame.size.width-10, 20)];
        _departmentLabel.textColor = [UIColor colorWithHexString:@"0x1493F9"];
        [_bgView addSubview:_departmentLabel];
        
        _contentLabel = [[UILabel alloc] initWithFrame:CGRectMake(5, 25, _bgView.frame.size.width-10, 70)];
        _contentLabel.font = [UIFont systemFontOfSize:14.0];
        _contentLabel.numberOfLines = 3;
        [_bgView addSubview:_contentLabel];
        
        _timerLabel = [[UILabel alloc] initWithFrame:CGRectMake(_bgView.frame.size.width-130, 95, 130, 20)];
        _timerLabel.font = [UIFont systemFontOfSize:14.0];
        [_bgView addSubview:_timerLabel];
    }
    return self;
}

- (void)setDataList:(NSDictionary *)dataList
{
    _dataList = dataList;
    _departmentLabel.text = [dataList objectForKey:@"title"];
    _contentLabel.text = [dataList objectForKey:@"content"];
    _timerLabel.text = [dataList objectForKey:@"timer"];
}

@end
